package icedot.library.common.base;


import android.app.Activity;
import android.os.Bundle;


import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.UUID;

public class BaseFragment extends Fragment
{
    protected boolean _active = false;
	protected String _uuid;
	
	@Override
	public void onCreate(Bundle savedInstanceState) 
	{
		_uuid = UUID.randomUUID().toString();
		Logger.showDebugMsg("UUID",this.getClass().getSimpleName() + "--" + _uuid);
		super.onCreate(savedInstanceState);
		Logger.showDebugMsg(this.getClass().getSimpleName(), "onCreate");
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) 
	{
		Logger.showDebugMsg(this.getClass().getSimpleName(), "onCreateView");
		return super.onCreateView(inflater, container, savedInstanceState);
	}
	
	@Override
	public void onActivityCreated(Bundle savedInstanceState) 
	{
		super.onActivityCreated(savedInstanceState);
		Logger.showDebugMsg(this.getClass().getSimpleName(), "onActivityCreated");
	}
	
	@Override
	public void onStart() 
	{
		super.onStart();
		Logger.showDebugMsg(this.getClass().getSimpleName(), "onStart");
	}
	
	@Override
	public void onResume() 
	{
		super.onResume();
		_active = true;
		Logger.showDebugMsg(this.getClass().getSimpleName(), "onResume");
	}
	
	@Override
	public void onPause() 
	{
		super.onPause();
		_active = false;
		Logger.showDebugMsg(this.getClass().getSimpleName(), "onPause");
	}
	
	@Override
	public void onDestroyView() 
	{
		super.onDestroyView();
		Logger.showDebugMsg(this.getClass().getSimpleName(), "onDestroyView");
	}
	
	@Override
	public void onDestroy() 
	{
		super.onDestroy();
		Logger.showDebugMsg(this.getClass().getSimpleName(), "onDestroy");
	}
	
	@Override
	public void onDetach() 
	{
		super.onDetach();
		Logger.showDebugMsg(this.getClass().getSimpleName(), "onDetach");
	}

	public String getUuid()
	{
		return _uuid;
	}

	public void needUpdate()
	{
		
	}

	public void needUpdate(int type,Object obj)
	{

	}
}
